package com.accp.www.chat;

import java.util.Date;

public class ChatMessage {

	public static final int TYPE_PUBLIC=1;
	public static final int TYPE_PRIVATE=2;
	public static final int TYPE_SYSTEM=3;
	
	private ChatUser fromUser;
	private ChatUser toUser;
	private String messageText;
	private Date sendTime;
	private int type;
	
	public ChatMessage(ChatUser fromUser, String messageText) {
		super();
		this.fromUser = fromUser;
		this.toUser = null;
		this.messageText = messageText;
		this.sendTime=new Date();
		this.type=TYPE_PUBLIC;
	}
	
	public ChatMessage(ChatUser fromUser, ChatUser toUser, String messageText) {
		super();
		this.fromUser = fromUser;
		this.toUser = toUser;
		this.messageText = messageText;
		this.sendTime=new Date();
		this.type=TYPE_PRIVATE;
	}
	
	public ChatUser getFromUser() {
		return fromUser;
	}
	
	public void setFromUser(ChatUser fromUser) {
		this.fromUser = fromUser;
	}
	
	public ChatUser getToUser() {
		return toUser;
	}
	
	public void setToUser(ChatUser toUser) {
		this.toUser = toUser;
	}
	
	public String getMessageText() {
		return messageText;
	}
	
	public void setMessageText(String messageText) {
		this.messageText = messageText;
	}
	
	public Date getSendTime() {
		return sendTime;
	}
	
	public void setSendTime(Date sendTime) {
		this.sendTime = sendTime;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}
	
}